<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateChaptersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('chapters', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->softDeletes();
            $table->string('chapter_name');
            $table->integer('novel_id');
            $table->integer('order_num');
            $table->text('content');
            $table->integer('word_num');
            $table->char('publish', 1)->default('N')->comment('是否发布');
            $table->char('is_vip', 1)->default('N')->comment('是否收费');
            $table->integer('coupon')->default(0)->comment('如果不是 0 , 以这个为准, 否则以千字收费');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('chapters');
    }
}
